﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyProcess.aspx.cs" Inherits="DepInnerTask.MyProcess" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>流程跟踪</title>
    <link href="CSS/style.css" rel="stylesheet" rev="stylesheet" />
    <link href="CSS/global.css" rel="stylesheet" rev="stylesheet" />
    <link href="CSS/UI_Css/jquery-ui-1.8.17.custom.css" rel="stylesheet" rev="stylesheet" />
    <script type="text/javascript" src="script/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="script/jquery-ui-1.8.17.custom.min.js"></script>
    <script type="text/javascript" src="script/My97DatePicker_4.72/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        $(function () {
            setTab(<%=Index%>);
            $('#tabs').tabs({ selected: <%=Index%>,
                select: function (event, ui) {
                    setTab(ui.index);
                }
            });
        });
        function setTab(index) {
            $("#li" + index).addClass("currently");
            $("#li" + index).siblings().removeClass("currently");
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div id="right">
            <div class="place">
                <div class="placeleft">
                    <i></i>您当前的位置：<a href="">首页</a> >> <strong><b>我发起的</b></strong>
                </div>
                <a href="#" class="shuaxin">刷新</a>
            </div>
            <%--class="currently"  endDate.focus();--%>
        </div>
        <div class="listTable_1">
            <div class="tableTab" id="tabs">
                <div class="place">
                    <div class="placeleft">
                        <ul>
                            <li class="currently" id="li0"><a href="#MyTask">我发起的</a></li>
                            <li id="li1"><a href="#CompleteTask">我经办的</a></li>
                        </ul>
                    </div>
                    <span class="more" style="display: inline-block"><a href="#">更多>></a></span>
                </div>
                <div id="MyTask">
                    <table border="0" cellpadding="0" cellspacing="0" class="listTable1">
                        <tr>
                            <td>
                                流程标题
                            </td>
                            <td>
                                业务编号
                            </td>
                            <td>
                                当前处理人
                            </td>
                            <td>
                                发起时间
                            </td>
                            <td>
                                流程状态
                            </td>
                            <td>
                                所属流程
                            </td>
                            <td rowspan="2">
                                <asp:Button ID="btnSearch" runat="server" Text="查询" CssClass="btnBg" OnClick="btnSearch_Click"
                                     />
                                <a href="#" class="searchLink" onclick="changeQuery('tbQuery')">
                                    <br />
                                    扩展条件</a>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <input type="text" name="processName" id="processName" class="inputBorder" runat="server" />
                            </td>
                            <td>
                                <input type="text" name="bussinessID" id="bussinessID" class="inputBorder" runat="server" />
                            </td>
                            <td>
                                <input type="text" name="applicantUser" id="applicantUser" class="inputBorder" runat="server" />
                            </td>
                            <td>
                                <%--<input type="text" name="taskStartTime" id="taskStartTime" class="inputboder1 inputBg2" runat="server"  />--%><input
                                    id="startDate" class="Wdate inputboder1" type="text" onfocus="var endDate=$dp.$('endDate');WdatePicker({onpicked:function(){},maxDate:'#F{$dp.$D(\'endDate\')}'})"
                                    runat="server" />-<input id="endDate" class="Wdate" type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startDate\')}'})"
                                        runat="server" />
                                <%--<input type="text" name="taskEndTime" id="taskEndTime" class="inputboder1 inputBg2" runat="server" />--%>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlTaskStatus" runat="server" CssClass="inputBorder" Height="22px">
                                    <asp:ListItem Value="0">所有...</asp:ListItem>    
                                    <asp:ListItem Value="1">还有3天到期</asp:ListItem>
                                    <asp:ListItem Value="2">还有2天到期</asp:ListItem>
                                    <asp:ListItem Value="3">还有1天到期</asp:ListItem>
                                    <asp:ListItem Value="4">当天到期</asp:ListItem>
                                    <asp:ListItem Value="5">超期</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlProcessCatalog" runat="server" CssClass="inputBorder" Height="22px">
                                    
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7">
                                <table border="0" cellpadding="0" cellspacing="0" class="listTable2" id="tbQuery"
                                    style="display: none">
                                    
                                    <tr>
                                    
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                    <table border="0" cellpadding="0" cellspacing="0" class="listTable3">
                        <tr>
                            <th>
                            </th>
                            <th>
                                <input name="" type="checkbox" value="" />
                            </th>
                            <th>
                                业务编号
                            </th>
                            <th>
                                流程标题
                            </th>
                            <th>
                                发起人
                            </th>
                            <th>
                           流程状态
                            </th>
                            <th>
                               当前环节
                            </th>
                             <th>
                               当前处理人
                            </th>
                            <th>
                               所属流程
                            </th>
                            
                        </tr>
                        <asp:Repeater ID="rpMyTask" runat="server">
                            <ItemTemplate>
                                <tr>
                                    <td>
                                        <img src="images/icon3.gif" />
                                    </td>
                                    <td>
                                        <input name="" type="checkbox" value="" />
                                    </td>
                                   <td>
                                        <%#Eval("SUMMARY")%>
                                    </td>
                                    <td>
                                        <%#Eval("SUMMARY")%>
                                    </td>
                                    <td>
                                        <%#Eval("INITIATOR")%>
                                    </td>
                                    <td>
                                     
                                         <%#GetStatusString(Eval("ENDTIME").ToString())%>
                                          </td>
                                   
                                    <td>
                                        <%#Eval("STEPLABEL") %>
                              
                                        </td>
                                         <td>
                                        <%#Eval("ASSIGNEDTOUSER")%>
                                    </td>
                                    <td>
                                        <%#Eval("PROCESSNAME") %>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                        <tr>
                            <td colspan="6">
                                <webdiyer:AspNetPager ID="pagination" runat="server" Width="100%" meta:resourcekey="pagination"
                                    CssClass="aspNetPager" CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页"
                                    PrevPageText="上一页" FirstPageText="首页" LastPageText="末页" OnPageChanging="pagination_PageChanging"
                                    PageIndexBoxType="DropDownList" ShowCustomInfoSection="Left" NavigationToolTipTextFormatString='{0}'
                                    NumericButtonTextFormatString="{0}">
                                </webdiyer:AspNetPager>
                            </td>
                        </tr>
                    </table>
                </div>
                <%--我的已办--%>
      <div id="CompleteTask">
                    <table border="0" cellpadding="0" cellspacing="0" class="listTable1">
                        <tr>
                            <td>
                                流程标题
                            </td>
                            <td>
                                业务编号
                            </td>
                            <td>
                                当前处理人
                            </td>
                            <td>
                                发起时间
                            </td>
                            <td>
                                流程状态
                            </td>
                            <td>
                                所属流程
                            </td>
                            <td rowspan="2">
                                <asp:Button ID="btnSearchCom" runat="server" Text="查询" CssClass="btnBg"  OnClick="btnSearchCom_Click"/>

                                <a href="#" class="searchLink" onclick="changeQuery('tbQueryFin')">
                                    <br />
                                    扩展条件</a>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <input type="text" name="processNameCom" id="processNameCom" class="inputBorder"
                                    runat="server" />
                            </td>
                            <td>
                                <input type="text" name="bussinessID" id="bussinessIDCom" class="inputBorder" runat="server" />
                            </td>
                            <td>
                                <input type="text" name="applicantUser" id="applicantUserCom" class="inputBorder"
                                    runat="server" />
                            </td>
                            <td>
                                <%--<input type="text" name="taskStartTime" id="taskStartTime" class="inputboder1 inputBg2" runat="server"  />--%><input
                                    id="startDateCom" class="Wdate inputboder1" type="text" onfocus="var endDateCom=$dp.$('endDateCom');WdatePicker({onpicked:function(){},maxDate:'#F{$dp.$D(\'endDateCom\')}'})"
                                    runat="server" />-<input id="endDateCom" class="Wdate" type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startDateCom\')}'})"
                                        runat="server" />
                                <%--<input type="text" name="taskEndTime" id="taskEndTime" class="inputboder1 inputBg2" runat="server" />--%>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlStatusCom" runat="server" CssClass="inputBorder" Height="22px">
                                    <asp:ListItem Value="0">所有</asp:ListItem>
                                    <asp:ListItem Value="1">还有3天到期</asp:ListItem>
                                    <asp:ListItem Value="2">还有2天到期</asp:ListItem>
                                    <asp:ListItem Value="3">还有1天到期</asp:ListItem>
                                    <asp:ListItem Value="4">当天到期</asp:ListItem>
                                    <asp:ListItem Value="5">超期</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlFinProcess" runat="server" CssClass="inputBorder" Height="22px">
                                    
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7">
                                <table border="0" cellpadding="0" cellspacing="0" class="listTable2" id="tbQueryFin"
                                    style="display: none">
                                    <tr>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                    <table border="0" cellpadding="0" cellspacing="0" class="listTable3">
                        <tr>
                            <th>
                            </th>
                            <th>
                                <input name="" type="checkbox" value="" />
                            </th>
                            <th>
                                业务编号
                            </th>
                            <th>
                                流程标题
                            </th>
                            <th>
                                发起人
                            </th>
                            <th>
                           流程状态
                            </th>
                            <th>
                               当前环节
                            </th>
                             <th>
                               当前处理人
                            </th>
                            <th>
                               所属流程
                            </th>
                            
                        </tr>
                        <asp:Repeater ID="rpCompleteTask" runat="server">
                            <ItemTemplate>
                                <tr>
                                    <td>
                                        <img src="images/icon3.gif" />
                                    </td>
                                    <td>
                                        <input name="" type="checkbox" value="" />
                                    </td>
                                   <td>
                                        <%#Eval("SUMMARY")%>
                                    </td>
                                    <td>
                                        <%#Eval("SUMMARY")%>
                                    </td>
                                    <td>
                                        <%#Eval("INITIATOR")%>
                                    </td>
                                    <td>
                                         <%#GetStatusString(Eval("ENDTIME").ToString())%>
                                          </td>
                                   
                                    <td>
                                        <%#Eval("STEPLABEL") %>
                              
                                        </td>
                                         <td>
                                        <%#Eval("ASSIGNEDTOUSER")%>
                                    </td>
                                    <td>
                                        <%#Eval("PROCESSNAME") %>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                        <tr>
                            <td colspan="6">
                                <webdiyer:AspNetPager ID="AspNetPager1" runat="server" Width="100%" meta:resourcekey="AspNetPager1"
                                    CssClass="aspNetPager" CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页"
                                    PrevPageText="上一页" FirstPageText="首页" LastPageText="末页" OnPageChanging="AspNetPager1_PageChanging"
                                    PageIndexBoxType="DropDownList" ShowCustomInfoSection="Left" NavigationToolTipTextFormatString='{0}'
                                    NumericButtonTextFormatString="{0}">
                                </webdiyer:AspNetPager>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
    </form>
    <script type="text/javascript">
        var ddlProcessCatalog = $("#<%=ddlProcessCatalog.ClientID %>");
        var ddlFinProcess = $("#<%=ddlFinProcess.ClientID %>");
        ddlProcessCatalog.change(function () {
            $("#tbQuery").hide();
        });

        ddlFinProcess.change(function () {
            $("#tbQueryFin").hide();
        });

        function changeQuery(tablename) {
            var processID;
            if (tablename == "tbQuery") {
                processID = ddlProcessCatalog.val();
            } else {
                processID = ddlFinProcess.val();
            }
            if (processID == "0") {
                alert("请先确定您需查询任务的所属流程，再点击扩展条件增加业务字段查询条件，谢谢!");
            } else {


                if ($("#" + tablename + " tr").length > 1) {
                    //alert($("#tbQuery tr").length);
                    //alert($("#tbQuery tr").eq(0));
                    $("#" + tablename + " tr").each(function (i) {
                        if (i == 0 || i == 1) {
                            $(this).remove();
                        }
                    });
                }
                $.post("~/Task/AjaxPage/GetExtCondition.aspx", { ProcessID: processID }, function (data) {
                    $("#" + tablename + " tr:last-child").before(data);
                });
                $("#" + tablename).toggle();
            }
        }
    </script>
</body>
</html>


